package com.example.demo.controller;

import com.example.demo.service.PdfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;

/**
 * @author 谢辉
 * @Classname PdfController
 * @Description TODO
 * @Date 2020/12/4 16:09
 */
@Controller
@RequestMapping("/pdf")
public class PdfController {
    @Autowired
    private PdfService pdfService;

    @RequestMapping("/getpdf")
    public void getPDF(@RequestParam("urlfilepath") String urlfilepath, HttpServletResponse response) throws Exception {
        pdfService.getPDF(urlfilepath,response);
    }
}
